import java.util.HashMap;
import java.util.Map;


public class BasicMathOperatorFactory implements MathOperatorFactory {
	
	private Map<String, MathOperator> operators = new HashMap<String, MathOperator>();
	
	public BasicMathOperatorFactory()
	{
		operators.put("+", new AddOperator());
		operators.put("-", new SubtractOperator());
		operators.put("sin", new SinOperator());
	}
	
	public MathOperator getMathOperatorFor(String operator)
	{
		MathOperator op = operators.get(operator);
		return (op != null) ? op : new NullMathOperator(); 
	}
	
}
